package com.tcm.user.persistence;


import com.base.core.exception.ServiceException;
import com.base.core.utils.R;
import com.tcm.user.model.dto.LoginAuthDTO;
import com.tcm.user.model.query.LoginAuthQuery;
import com.tcm.user.model.entity.LoginAuth;

import java.util.List;

public interface LoginAuthPersisService {
    Long save(LoginAuth loginAuth) throws ServiceException;

    int update(LoginAuth loginAuth) throws ServiceException;

    LoginAuth findByUsername(String identifier, String clientType);

    R queryUser(LoginAuth loginAuth) throws ServiceException;

    R findByUserId(Long userId, String clientType) throws ServiceException;

    LoginAuth findByMobile(String mobile, String clientType);

    List<LoginAuthDTO> queryByMobile(List<String> mobileList, String clientType);

    R changeCredential(LoginAuthQuery userParams);

    R changeUsername(LoginAuthQuery userParams);

    R changeMobile(LoginAuthQuery userParams);

    R checkUsernameExists(String username, Long userId, String clientType);

    R checkMobileExists(String mobile, Long userId, String clientType);
}
